package cn.edu.scau.cmi.chenruilin.factory;

import cn.edu.scau.cmi.chenruilin.domain.Beef;
import cn.edu.scau.cmi.chenruilin.domain.Chicken;
import cn.edu.scau.cmi.chenruilin.domain.Meat;
import cn.edu.scau.cmi.chenruilin.domain.Pork;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;

public class Controller {

    @FXML
    private Label output;

    @FXML
    private Button chicken;

    @FXML
    private Button beef;

    @FXML
    private Button pork;

    @FXML
    void createBeefFactory() {
    	MeatFactory meatFactory = new BeefMeatFactory();
    	Meat meat = meatFactory.getInstance();
    	String out = "牛肉工厂创建成功\n" + meat.cook();
    	output.setText(out);
    }
    

    @FXML
    void createPorkFactory() {
    	MeatFactory meatFactory = new PorkMeatFactory();
    	Meat meat = meatFactory.getInstance();
    	String out = "猪肉工厂创建成功\n" + meat.cook();
    	output.setText(out);
    }

    @FXML
    void createChickenFactory() {
    	MeatFactory meatFactory = new ChickenMeatFactory();
    	Meat meat = meatFactory.getInstance();
    	String out = "鸡肉工厂创建成功\n" + meat.cook();
    	output.setText(out);
    }

}